<?php

namespace app\admin\model\setup;

use think\Model;

/**
 * Companies
 */
class Companies extends Model
{
    // 表主键
    protected $pk = 'coycode';
    
    // 表名
    protected $name = 'setup_companies';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function currencydefaultTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Currencies::class, 'currencydefault', 'currabrev');
    }

    public function debtorsactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'debtorsact', 'accountcode');
    }

    public function pytdiscountactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'pytdiscountact', 'accountcode');
    }

    public function creditorsactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'creditorsact', 'accountcode');
    }

    public function payrollactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'payrollact', 'accountcode');
    }

    public function grnactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'grnact', 'accountcode');
    }

    public function exchangediffactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'exchangediffact', 'accountcode');
    }

    public function purchasesexchangediffactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'purchasesexchangediffact', 'accountcode');
    }

    public function freightactTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'freightact', 'accountcode');
    }

    public function retainedearningsTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'retainedearnings', 'accountcode');
    }
}